
type AndNull<T> = T | null

export interface UserIdType {
  user_id: string;
}

export interface DeptIdType {
  dept_id: string;
}

export interface AutoQuotaType extends UserIdType {
  water_usage_ids: string | number;
  water_use_people: number;
}

export interface queryBillingType extends UserIdType {
  scheme_id: string;
}

export interface UseWaterFormType {
  quota_calc_type: AndNull<number>; //用水指标类型，是否是自动计算
  rate_calc_type: AndNull<number>; // 用水比例类型，是否是自动计算
  use_water_people: AndNull<number>; // 用水人口
  water_usage_list: UseWaterType[]; // 用水类别列表
}

export interface UseWaterType {
  water_quota: number | string;
  water_rate: number | string;
  water_usage_id: number | string;
  created_time?: string;
  dept_id?: string;
  user_water_usage_id?: string;
  water_usage_name?: string;
  show_quota?: boolean;
}

export interface HideWaterType {
  use_water_type: string[];
  use_water_people: AndNull<number>;
  water_quota: string[];
}

export interface DiscountsFormType {
  discountsData: DiscountsListType[];
}

type UserAndDept = UserIdType & DeptIdType;
interface DiscountsListType extends Partial<UserAndDept> {
  end_time: string;
  order_num: string | number;
  preferential_config_id: string;
  start_time: string;
  time: string[];
  preferential_name?: string;
  id: string | number;
}

export interface HideDiscountsDataType {
  discounts: string[];
}

export interface BillingSettingFormType {
  billing_info_list: any[];
  billing_scheme_id: string;
  billing_scheme_name: string;
  discount_rate_list: any[];
  price_type: number;
  use_water_people: number;
}

export interface Options {
  [x: string]: string | number
}
